<template>
  <el-dialog :visible.sync="show" title="二维码">
    <div style="text-align: center">
      <canvas ref="canvascode"></canvas>
    </div>
  </el-dialog>
</template>

<script>
import Qrcode from 'qrcode'
export default {
  data () {
    return {
      show: false
    }
  },
  methods: {
    toCode (str) {
      Qrcode.toCanvas(this.$refs.canvascode, str, {
        width: 500
      })
    }
  }
}
</script>

<style></style>
